package cn.edu.scau.sec.caixiaoqing.factoryPattern.factory;

import cn.edu.scau.sec.caixiaoqing.factory.bean.ConsumerElectronics;

import java.lang.reflect.Constructor;


public abstract class ConsumerElectronicsFactory {

    public static ConsumerElectronicsFactory getConsumerElectronicsFactory(String consumerElectronicsType) throws Exception {

        Class<?> Factory = Class.forName(consumerElectronicsType);
        Constructor<?> constructor = Factory.getConstructor();

        return (ConsumerElectronicsFactory) constructor.newInstance();
    }
    public abstract ConsumerElectronics getConsumerElectronics();
}
